<template>
  <div class="home">
    <el-header>
      <el-select v-model="selectedValue" placeholder="请选择电站" @change="handleSelect">
        <el-option v-for="item in stationList" :key="item.id" :label="item.name" :value="item.id" />
      </el-select>

      <StationMenu />
    </el-header>
    <el-container>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>
<script lang="ts" setup>
import StationMenu from '@/components/StationMenu.vue'
import { ref } from 'vue'
const stationList = ref([
  { id: 1, name: '电站1号' },
  { id: 2, name: '电站2号' },
])
const selectedValue = ref(1)
const handleSelect = (value: number) => {
  console.log('Selected station ID:', value)
  // 在这里可以根据选中的电站ID进行相应的操作
}
</script>
<style lang="scss" scoped>
.home {
  height: 100vh;

  .el-header {
    background: #011532;
    color: #fff;
    line-height: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 24px;

    .logo {
      display: flex;
      align-items: center;

      img {
        width: 30px;
        margin-right: 13px;
      }

      .name {
        font-size: 24px;
        font-weight: 500;
      }
    }

    .el-select {
      width: 2rem;
      margin-right: 1rem;
    }

  }

  .el-container {
    .el-main {
      height: calc(100vh - 60px);
      background: #F7F8FA;
      padding: 0;
      border-radius: 4px 4px 0 0;
    }
  }
}
</style>